﻿--#include "data\functions\Activity\DailyActivity\BaoZangActivity.lua" once					--宝藏传说

local npcId = 200
NpcDialog[npcId] = {}
local t = NpcDialog[npcId]

t.main = function(sysarg)
	
	
	local strCond		= Lang.ScriptTips.BaoZang002
	local strDesc 		= ""
	local okBtn 		= ""			--{按钮;样式;按钮名;函数名;描述}
	local strBtnList 	= ""

	strDesc = Lang.ScriptTips.BaoZang003
	okBtn 		= "{btn;0;".. Lang.ScriptTips.buttonEnter ..";%s;}"			--{按钮;样式;按钮名;函数名;描述}
	strBtnList 	= strBtnList .. string.format(okBtn, "Enter")


	local pack = DataPack.allocPacket(sysarg, LogicCmd.npcDialogSys.sysID, LogicCmd.npcDialogSys.sub.sNpcDlgData)
	DataPack.writeUint64(pack, Actor.getNpc(sysarg))
	DataPack.writeByte(pack, NpcDialogType.GeneralNpcDlg)
	DataPack.writeString(pack, strCond)
	DataPack.writeString(pack, strDesc)
	DataPack.writeString(pack, strBtnList)
	DataPack.writeChar(pack, -1)
	DataPack.writeByte(pack, 0);
	DataPack.flush(pack)
end

t.Enter = function(sysarg)
	if(Actor.checkActorLevel(sysarg, BaoZangConfig.levelLimit[2], BaoZangConfig.levelLimit[1])~=true)then
		return Actor.sendTipmsg( sysarg, string.format(Lang.ScriptTips.ActivityGuide002,BaoZangConfig.levelLimit[2]), ttFlyTip )
	end
	local sysVar = System.getDyanmicVar()
	if(sysVar.baoZangActiivtyStart == nil or sysVar.baoZangActiivtyStart < 1)then	
		return Actor.sendTipmsg( sysarg, Lang.ScriptTips.ActivityGuide003, ttFlyTip )
	end	

	EnterBaoZangScene(sysarg)
end







